package File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LXW
 * Date: 2022-04-04
 * Time: 13:57
 */
public class Demo14 {
    public static void main(String[] args) {
        try (OutputStream outputStream = new FileOutputStream("hello-world")){
            String s = "你好中国";
            byte[] bytes = s.getBytes(StandardCharsets.UTF_8);
            outputStream.write(bytes);
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
}
